<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") / >
<cfset statusQueries = CreateObject("component", "#session.rootDir#.cfc.statusQueries") />
<cfset baseQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />

<cfoutput>    
<!---HTML header, css links, js links, and page title--->
#BASE.htmlHeaderNonSCF(
    "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js,../js/Step4-BadgeReport.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 4:  HR - Badge Creation Report", <!---Page Title--->
    "Status", <!---Active Nav Link--->
    "true" <!---Alternate menu.  Shows main EPAR links--->
)#
<!---HTML header, css links, js links, and page title--->  

<cfif Session.Auth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>   

        <h1 class="title">Step 4:  HR - Badge Creation Report</h1>
        <div class="entry">
            Welcome, #Session.arrEmpInfo.FirstName# #Session.EmpInfo.LastName#.  
            In this step, you'll use this Badge Creation Report to generate the 
            employee badges and provide the resulting badge numbers.  <BR /> <BR />
        
        <cfset QUERIES.GetStep4Waiting = statusQueries.funcGetNONSCFStepWaiting(5) />
            
        <cfif QUERIES.GetStep4Waiting.recordcount GT 0>
            	<cfform name="frmStep4" method="post" action="api.cfm?api=step4_badge_creation_nonscf">
                <!--- This form action is different from the action for regular SCF Employees.  SCF Employees are scheduled to come through in batches
the correlate with Orientation.  Therefore the SCF Employee Badge Report page requires all badges be completed before allowing the 
form submission.  Contractors/Volunteers (or other Non-SCF direct hires) can be processed at any time and on an individual basis.
Therefore, this form will allow empty badge numbers and will only update badges where appropriate.--->
            	<table width = 100%>
                	<tr>
                    	<td colspan="5">
            				<span class="tableHeader">Badge Creation Report</span>   
                        </td>
                    	<td align="right">
            				<a href="PrintBadgeReport.cfm" target="_blank">Print Report</a>   
                        </td>
                    </tr>
                    <tr>
                        <td width =25%>&nbsp;</td> 
                        <td><u>##</u></td> 
                        <td width=5%>&nbsp;</td> 
                        <td nowrap="nowrap">
                        	<strong><u>Name, Job Title, &amp; Department</u></strong>
                        </td>
                        <td width =30%>&nbsp;</td> 
                        <td>
                        	<strong><u>New Badge ##</u></strong>
                        </td>
                        <td width=35%>&nbsp;</td>  
                    </tr>
                    <cfloop from="1" to="#QUERIES.GetStep4Waiting.RecordCount#" index="i">

                        <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo(QUERIES.GetStep4Waiting.ID[i]) />                    
                        <cfset QUERIES.GetDepts = baseQueries.funcGetDepts(QUERIES.GetEmpInfo.DeptID) />

                    <tr>
                        <td>&nbsp;</td> 
                        <td valign="top">#i#)</td> 
                        <td>&nbsp;</td>  
                        <td nowrap="nowrap">
                        	#QUERIES.GetStep4Waiting.Name[i]#<BR />
                            #QUERIES.GetEmpInfo.BadgePos#<BR />
                            #QUERIES.GetDepts.OrganizationDescription#<BR />
                        </td>
                        <td>&nbsp;</td> 
                        <td align="right">
                        	<cfinput type="text" name="Badge_#QUERIES.GetEmpInfo.ID#_#QUERIES.GetStep4Waiting.ID[i]#" 
                        	   error_message="The badge number for '#QUERIES.GetStep4Waiting.Name[i]#' must be numeric.  
                        	       Please provide the number on the back of their badge.">
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td> 
                    </tr>
                    </cfloop>
                    
                    <tr>
                        <td colspan="6" align="right">
                        	<cfinput type="hidden" name="FormIndicator" value="0">
                        	<cfinput type="button" name="Submit" value="Submit">
                        </td> 
                    </tr>
                </table>
                </cfform>  
            <cfelse>
            	<span class="error">At the present time, there are not any employees staged for new badges.</span>
            </cfif>
         	            
        </div>
    
<cfelse>
	<cfinclude template="../denied.cfm">
</cfif>
    

    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
    #BASE.htmlFooterNonSCF()#
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>


